package com.restaurant.config;

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaSparkContext;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class SparkConfig {
    private static final String SPARK_HOME = ".";

    private static final String APP_NAME = "Demo";

    private static final String MASTER = "local";

    private SparkConf getSparkConfig() {
        return new SparkConf().setAppName(APP_NAME).setMaster(MASTER);
    }

    @Bean
    public JavaSparkContext getSparkContext() {
        SparkConf sparkConf = new SparkConf().setAppName(APP_NAME).setMaster(MASTER);
        return new JavaSparkContext(sparkConf);
    }

}